import json, parameterized, unittest, utils
import time

from api.comm import CommAIP


class TestComm(unittest.TestCase):

    def setUp(self) -> None:
        pass

    def tearDown(self) -> None:
        pass

    @parameterized.parameterized.expand(utils.data_build())
    def test01_comm(self, data):
        self.comm = CommAIP(data)
        server_response = self.comm.get_response().json()
        data_response = eval(data.get("response"))
        for i in data_response:
            print(i)
            self.assertEqual(data_response.get(i), server_response.get(i))
